//
//  UIView+Extension.h
//  AwesRecorder
//
//  Created by LenTi on 2019/8/27.
//  Copyright © 2019 VoiceRecorder. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Extension)

@property (assign, nonatomic) CGFloat top;
@property (assign, nonatomic) CGFloat bottom;
@property (assign, nonatomic) CGFloat left;
@property (assign, nonatomic) CGFloat right;

@property (assign, nonatomic) CGFloat x;
@property (assign, nonatomic) CGFloat y;
@property (assign, nonatomic) CGPoint origin;

@property (assign, nonatomic) CGFloat centerX;
@property (assign, nonatomic) CGFloat centerY;

@property (assign, nonatomic) CGFloat width;
@property (assign, nonatomic) CGFloat height;
@property (assign, nonatomic) CGSize  size;

/**
 删除所有子视图
 */
- (void) removeAllSubViews;

/**
 *  需要类名和xib名字一样
 *
 *  @return 实例
 */
+ (instancetype)loadFromXib;

/**
 需要类名和nib名字一样
 
 @return 实例
 */
+ (instancetype)loadFromNib;

/**
 设置圆角
 
 @param corners 类型
 */
- (void)setRoundingCorners:(UIRectCorner)corners;

/**
 设置全息圈
 
 @param centerFrame 圈子大小
 */
- (void)setHolloCircleWithCenterFrame:(CGRect)centerFrame;

/**
 设置全息矩形
 
 @param centerFrame 矩形大小
 */
- (void)setHollowRectangleWithCenterFrame:(CGRect)centerFrame;

/**
 截取图片
 
 @param frame 截图范围大小
 @return 图片
 */
- (UIImage *)imageFromViewWithFrame:(CGRect)frame;

/// 获取当前视图的控制器
- (UIViewController*)viewController;


@end
